package ua.pp.fland.rest.simple.client;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ua.com.stormlabs.tiny.licenseserver.beans.User;

import java.net.SocketException;

/**
 * @author mbondarenko
 * @version 1.0 12/24/12
 */
public class Main {

    private static final Logger log = LoggerFactory.getLogger(Main.class);

    public static void main(String[] args) throws SocketException {
        log.debug("App started...");

        LicenseValidator licenseValidator = new LicenseValidator("https://127.0.0.1:8443/lcs");
        String login = "Mr.Smith";
        String password = "vyT2K5Hxu7opY8R9Suak";
        ValidationResult validationResult = licenseValidator.validate(login, password);
        log.debug(validationResult.getText());
        User user = licenseValidator.getUserDetails(login, password);
        log.debug("User details: " + user);

        log.debug("App stopped.");
    }
}
